<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<script>


    config = {
        "iceServers": [{
            "urls": ["stun:stun.l.google.com:19302"]
        }],
        "iceTransportPolicy": "all",
        "iceCandidatePoolSize": "0"
    }

    local.addIceCandidate(remoteCandidate)
        .then(e=>{
            console.log("add success");
        })


    let senderChannel = localPeer.createDataChannel('dataChannel');
    senderChannel.onopen = ()=>{
        if(senderChannel.readyState === 'open'){
            senderChannel.send(someBuffer);
        }

    };

    senderChannel.birnayType = 'arrayBuffer';

    remotePeer.ondatachannel = function(event){
        // receive data from event.channel
        remotePeer = event.channel;
        remotePeer.binaryType = 'arraybuffer';
        remotePeer.onmessage = onReceiveMessageCallback;
    }
</script>
</body>
</html>
